package cn.izeno.wx.models

import com.alibaba.fastjson.annotation.JSONField

/**
 * **订阅号 or 服务号**获取用户信息的 access_token
 * @since 2016-05-04 11:31:03
 */
class TokenUser {
  //只有在用户将公众号绑定到微信开放平台帐号后，才会出现该字段。
  @JSONField(name = "unionid")
  var unionId: String? = null

  @JSONField(name = "openid")
  var openId: String = ""
  @JSONField(name = "access_token")
  var accessToken: String? = null

  var scope: String = SCOPE_USER_INFO
  @JSONField(name = "expires_in")
  var expiresIn: String? = null
  @JSONField(name = "refresh_token")
  var refreshToken: String? = null
  @JSONField(name = "errcode")
  var errCode: Int = 0
  @JSONField(name = "errmsg")
  var errMsg: String? = null

  companion object {
    const val SCOPE_BASE = "snsapi_base"
    const val SCOPE_USER_INFO = "snsapi_userinfo"
  }
}
